#pragma once
#include "g2o/core/base_multi_edge.h"
#include "graph_optimizer/vertex/vertex_p.hpp"
#include "graph_optimizer/vertex/vertex_q.hpp"
#include "graph_optimizer/vertex/vertex_bg.hpp"
#include "graph_optimizer/preintegration/preintegration.hpp"
namespace g2o
{
    class EdgeOg : public BaseMultiEdge<9, std::shared_ptr<graph_optimizer::PreIntegration>>
    {
    public:
        EIGEN_MAKE_ALIGNED_OPERATOR_NEW
        EdgeOg();
        virtual bool read(std::istream &is) { return false; }
        virtual bool write(std::ostream &os) const { return false; }
        void computeError();
        virtual void linearizeOplus();
        virtual void setMeasurement(const std::shared_ptr<graph_optimizer::PreIntegration> &m)
        {
            _measurement = m;
            _information = _measurement->covariance_.inverse();
        }
    };
} // namespace g2o